﻿namespace HiMap.Carto
{
    using System;

    public class RasterBandClass : IRasterBand
    {
        protected internal string _Caption;
        protected internal string _FileLocation;
        protected internal double _MaxScale;
        protected internal double _MinScale;
        protected internal string _Name;
        protected internal string _Path;

        public RasterBandClass(string FileLocation)
        {
            this._FileLocation = FileLocation;
            this._MinScale = 0;
            this._MaxScale = 0;
            this.Ini();
        }

        public RasterBandClass(string FileLocation, double MinScale, double MaxScale)
        {
            this._FileLocation = FileLocation;
            this._MinScale = MinScale;
            this._MaxScale = MaxScale;
            this.Ini();
        }

        private void Ini()
        {
            if (this._FileLocation != "")
            {
                int startIndex = this._FileLocation.LastIndexOf(@"\") + 1;
                this._Name = this._FileLocation.Substring(startIndex);
                this._Caption = this._FileLocation.Substring(startIndex);
                this._Path = this._FileLocation.Substring(0, startIndex);
            }
        }

        public string Caption
        {
            get
            {
                return this._Caption;
            }
            set
            {
                this._Caption = value;
            }
        }

        public double MaxScale
        {
            get
            {
                return this._MaxScale;
            }
            set
            {
                this._MaxScale = value;
            }
        }

        public double MinScale
        {
            get
            {
                return this._MinScale;
            }
            set
            {
                this._MinScale = value;
            }
        }

        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this._Name = value;
            }
        }

        public string Path
        {
            get
            {
                return this._Path;
            }
            set
            {
                this._Path = value;
            }
        }
    }
}

